struct Solution {}

fn main() {}

impl Solution {
    pub fn sum_of_the_digits_of_harshad_number(x: i32) -> i32 {
        let s: u32 = x.to_string().chars().map(|x| (x.to_digit(10).unwrap())).collect::<Vec<u32>>().iter().sum();
        if x % s as i32 == 0 {
            return s as i32;
        }
        -1
    }
}